Chapter 6: Exercises

  1. (**) EPD by volume and HOD:
    1. Record your voice of "Singapore is a fine place" and save it as "test.wav", with the format of 16 KHz, 16 bits, mono. (Hint: You can use waveFileRecord.m in the SAP Toolbox for easy recording.)
    2. Write a script which do EPD by using volume and high-order difference. You should plot your result like this:
      (Hint: Be sure to understand all the examples provided in the text before you attemp this exercise. In particular, you should be familiar with the use of "line" command for adding lines to the existing plot.)
    3. Convert your script to a function epdByVolHod.m with the following usage:

      [epInSampleIndex, epInFrameIndex] = epdByVolHod(wave, fs, nbits, epdPrm, plotOpt)

      where

      • epInFrameIndex: two-element end-points in frame index
      • epInSampleIndex: two-element end-points in sample index
      • wave: input audio signals within [-1, 1];
      • fs: sample rate
      • epdPrm: EPD parameter, including three fields:
        • epdPrm.frameSize: frame size
        • epdPrm.overlap: overlap
        • epdPrm.diffOrder: the order of difference (default: 4)
        • epdPrm.volWeight: the weighting factor for volume (default: 0.5)
        • epdPrm.vhRatio: the constant for obtaining the VH threshold of VHmin+(VHmax-VHmin)*epdPrm.vhRatio (default 0.125)
      • plotOpt: 0 for silent operation, 1 for plotting the result (as shown in the previous sub-problem).
      Please test your program using the following script: waveFile='test.wav'; epdPrm.frameSize = 256; epdPrm.overlap = 0; epdPrm.diffOrder=4; epdPrm.volWeight=0.5; epdPrm.vhRatio = 0.125; plotOpt = 1; out = epdByVolHod(wave, fs, nbits, epdPrm, plotOpt);
    (Hint: You should finish part (b) before trying this one since it is trickier debugging an m-file function. When you are debugging your m-file function, be sure to issue "dbstop if error" or "dbstop if warning" to stop at the work space where errors/warnings occur. To clear the debugging flags, try "dbclear all". Also it would be better if you can follow the same flow as in epdByVol.m in the SAP Toolbox.)
  2. (*) Recordings of digits and letters: This is a recording task for digits and letters. Please refer to this page for details.
  3. (*) Recordings of voice commands: This is a recording task for voice commands. Please refer to this page for details.
  4. (***) Programming contest: end-point detection: Please read this page for details.
  5. (***) Fastest clapper in the world: This guy claims to be the fastest clapper in the world, with 721 claps in a minute, and 14 claps in a second (peak performance):
    http://www.youtube.com/watch?v=UAzsc6hP9zc&feature=fvwrel
    1. Write a program to verify that the peak performance is 14 claps per second, and indicate when it happens using the program. (Please draw the volume curve together with the first 1-sec window that encloses 14 claps, so TA can easily verify the correctness of your program.)
    2. Record your own clapping and demonstrate your peak performance by using your program.


Audio Signal Processing and Recognition (音訊處理與辨識)